---
apiVersion: v1
data:
  Corefile: |-
    . {
        local
        ready
        log
    }
kind: ConfigMap
metadata:
  name: coredns-configmap
---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    kind: client
    name: client
  name: client
spec:
  progressDeadlineSeconds: 600
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      kind: client
      name: client
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      labels:
        kind: client
        name: client
      name: client
    spec:
      containers:
        - command:
            - /bin/ash
            - -c
            - sleep 10000000
          env:
            - name: PORT
              value: "8080"
          image: quay.io/cilium/alpine-curl:v1.5.0@sha256:7b286939730d8af1149ef88dba15739d8330bb83d7d9853a23e5ab4043e2d33c
          imagePullPolicy: IfNotPresent
          name: client
          ports:
            - containerPort: 8080
              protocol: TCP
          securityContext:
            capabilities:
              add:
                - NET_RAW
---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    kind: client
    name: client2
  name: client2
spec:
  progressDeadlineSeconds: 600
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      kind: client
      name: client2
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      labels:
        kind: client
        name: client2
        other: client
      name: client2
    spec:
      containers:
        - command:
            - /bin/ash
            - -c
            - sleep 10000000
          env:
            - name: PORT
              value: "8080"
          image: quay.io/cilium/alpine-curl:v1.5.0@sha256:7b286939730d8af1149ef88dba15739d8330bb83d7d9853a23e5ab4043e2d33c
          imagePullPolicy: IfNotPresent
          name: client2
          ports:
            - containerPort: 8080
              protocol: TCP
          resources: {}
          securityContext:
            capabilities:
              add:
                - NET_RAW
---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    kind: echo
    name: echo-service-1
  name: echo-service-1
spec:
  progressDeadlineSeconds: 600
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      kind: echo
      name: echo-service-1
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      labels:
        kind: echo
        name: echo-service-1
        other: echo
      name: echo-service-1
    spec:
      affinity:
        podAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            - labelSelector:
                matchExpressions:
                  - key: name
                    operator: In
                    values:
                      - client
              topologyKey: kubernetes.io/hostname
      containers:
        - env:
            - name: PORT
              value: "8080"
          image: quay.io/cilium/json-mock:v1.3.2@sha256:bc6c46c74efadb135bc996c2467cece6989302371ef4e3f068361460abaf39be
          imagePullPolicy: IfNotPresent
          name: echo-service-1
          ports:
            - containerPort: 8080
              protocol: TCP
          readinessProbe:
            failureThreshold: 3
            httpGet:
              path: /
              port: 8080
              scheme: HTTP
            initialDelaySeconds: 1
            periodSeconds: 1
            successThreshold: 1
            timeoutSeconds: 2
          resources: {}
          securityContext:
            capabilities:
              add:
                - NET_RAW
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
        - args:
            - -conf
            - /etc/coredns/Corefile
          image: coredns/coredns:1.9.3@sha256:8e352a029d304ca7431c6507b56800636c321cb52289686a581ab70aaa8a2e2a
          imagePullPolicy: IfNotPresent
          name: dns-test-server
          ports:
            - containerPort: 53
              protocol: TCP
            - containerPort: 53
              protocol: UDP
          readinessProbe:
            failureThreshold: 3
            httpGet:
              path: /ready
              port: 8181
              scheme: HTTP
            initialDelaySeconds: 1
            periodSeconds: 1
            successThreshold: 1
            timeoutSeconds: 2
          resources: {}
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
          volumeMounts:
            - mountPath: /etc/coredns
              name: coredns-config-volume
              readOnly: true
      volumes:
        - configMap:
            defaultMode: 420
            items:
              - key: Corefile
                path: Corefile
            name: coredns-configmap
          name: coredns-config-volume
---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    kind: echo
    name: echo-service-2
  name: echo-service-2
spec:
  progressDeadlineSeconds: 600
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      kind: echo
      name: echo-service-2
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      labels:
        kind: echo
        name: echo-service-2
      name: echo-service-2
    spec:
      containers:
        - env:
            - name: PORT
              value: "8080"
          image: quay.io/cilium/json-mock:v1.3.2@sha256:bc6c46c74efadb135bc996c2467cece6989302371ef4e3f068361460abaf39be
          imagePullPolicy: IfNotPresent
          name: echo-service-2
          ports:
            - containerPort: 8080
              protocol: TCP
          readinessProbe:
            failureThreshold: 3
            httpGet:
              path: /
              port: 8080
              scheme: HTTP
            initialDelaySeconds: 1
            periodSeconds: 1
            successThreshold: 1
            timeoutSeconds: 2
          resources: {}
          securityContext:
            capabilities:
              add:
                - NET_RAW
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
        - args:
            - -conf
            - /etc/coredns/Corefile
          image: coredns/coredns:1.9.4@sha256:b82e294de6be763f73ae71266c8f5466e7e03c69f3a1de96efd570284d35bb18
          imagePullPolicy: IfNotPresent
          name: dns-test-server
          ports:
            - containerPort: 53
              protocol: TCP
            - containerPort: 53
              protocol: UDP
          readinessProbe:
            failureThreshold: 3
            httpGet:
              path: /ready
              port: 8181
              scheme: HTTP
            initialDelaySeconds: 1
            periodSeconds: 1
            successThreshold: 1
            timeoutSeconds: 2
          resources: {}
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
          volumeMounts:
            - mountPath: /etc/coredns
              name: coredns-config-volume
              readOnly: true
      volumes:
        - configMap:
            defaultMode: 420
            items:
              - key: Corefile
                path: Corefile
            name: coredns-configmap
          name: coredns-config-volume
---
apiVersion: v1
kind: Service
metadata:
  labels:
    kind: echo
  name: echo-service-1
spec:
  ports:
    - name: http
      port: 8080
      protocol: TCP
      targetPort: 8080
  selector:
    name: echo-service-1
  type: NodePort
---
apiVersion: v1
kind: Service
metadata:
  labels:
    kind: echo
  name: echo-service-2
spec:
  ports:
    - name: http
      port: 8080
      protocol: TCP
      targetPort: 8080
  selector:
    name: echo-service-2
  type: NodePort
